<%@ page language="java"  pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <link rel="stylesheet" href="${pageContext.request.contextPath }/css/info-mgt.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath }/css/base.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/info-reg.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/WdatePicker.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/common.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/WdatePicker.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.pagination.js"></script>
    <title>未审批界面</title>
	<style type="text/css">
		.article .title{ line-height:33px; background:url(${pageContext.request.contextPath }/images/righttitlebig.png) repeat-x; border:1px solid #c1d3de; overflow:visible;}
        .article .title h2{ margin-left:7px; padding-left:22px; font-weight:bold; font-size:14px; font-family:'瀹嬩綋'; color:#000000; background:url(${pageContext.request.contextPath }/images/titleico.png) no-repeat left center;}
		table tr .num{ width:63px; text-align: center;}
		
		table tr .appPerson{ width:110px;padding-left: 49px;}
		table tr .proName{ width:140px;padding-left: 65px;}
		table tr .proType{ width:60px; padding-left: 28px;}
		table tr .proDetail{ width:140px; padding-left: 59px;}
		table tr .appCash{ width:80px; padding-left: 15px;}
		table tr .appTime{ width:120px; padding-left: 55px;}
		table tr .exeTime{ width:80px; padding-left: 15px;}
		table tr .appStatus{ width:60px; padding-left: 25px;}
		table tr .operate{ width:89px; padding-left:45px;}
		table tr .operate a{ color:#2c7bbc;}
		table tr .operate a:hover{ text-decoration:underline;}
		#tablebody .cs{ text-align: center;}
		.skip_table tr td{ width: 80px; text-align: center;}
	</style>
	<script type="text/javascript" src="${pageContext.request.contextPath }/jquery2/jquery-2.1.1.js"></script>
	<script type="text/javascript">
	
		function skipPage(currentPage){
		//alert(1);
			//var datapost = '&currPage='+currentPage+'&proName='+$("#id_proName").val()+'&minTime='+$("#id_minTime").val()
						//+'&maxTime='+$("#id_maxTime").val();
		//alert(datapost);
      		var url='${pageContext.request.contextPath }/projectManage.action?method=queryNotExeApply&currPage='+currentPage;
 			url+='&proName='+document.getElementById("id_proName").value;
 			url+='&minTime='+document.getElementById("id_minTime").value;
 			url+='&maxTime='+document.getElementById("id_maxTime").value;
 			window.location.href=url;
 		}
 		function check(trObj,appid){
 			if($('#id_dept').val()=="总经理办公室"){
 				$("#id_a"+trObj).replaceWith("<a onclick='checkApply(1,"+appid+")' style='color:blue;'>审批</a>&nbsp;&nbsp;<a onclick='checkApply(2,"+appid+")' style='color:blue;'>驳回</a>&nbsp;&nbsp;"); 
 			}else{
 				alert("没有该权限操作，请联系管理员！");
 			}
 			
 		}
 		function checkApply(num,projectId,appPerson,appPersonNo){
 			if(num==1){
 				if(window.confirm("确定要审批该申请吗(不可更改)?")){
 					alert("审批成功！请到进行中项目查看！");
 					//trObj.innerHTML=' ';
 					var url='${ pageContext.request.contextPath}/projectManage.action?method=updateNotExeApply&id='+projectId;
 					//url+='&appPerson='+appPerson+'&appPersonNo='+appPersonNo;
 					window.location.href=url;
 				}
 			}else if(num==2){
 				if(window.confirm("确定要驳回该申请吗(不可更改)?")){
 					alert("驳回成功！请到已完成项目中查看！");
 					var url='${ pageContext.request.contextPath}/projectManage.action?method=insertCancelApply&id='+projectId;
 					//url+='&appPerson='+appPerson+'&appPersonNo='+appPersonNo;
 					window.location.href=url;
 				}
 			}
				
 		}
 		var oldColor;
      function choice(trObj){
        oldColor=trObj.bgColor;
      	trObj.bgColor = "skyblue";
      }
      function leave(trObj){
      	trObj.bgColor=oldColor;
      }
	</script>
  </head>
  
  <body>
  
  <div class="title">
    	<h2>待审批</h2>
    </div>
    <input type="hidden" value="${lwgKing.deptName}" id="id_dept"/>
    <form method="post" action="${pageContext.request.contextPath }/projectManage.action?method=queryNotExeApply">
		<div class="query"  style="background-color: #cca">
			<div class="query-conditions ue-clear">
			
				<div class="conditions name ue-clear">
		    		<label>项目名称：</label>
		    		<input type="text" name="proName" id="id_proName" value="${requestScope.search.proName }"/>
		    	</div>
        		<div class="conditions time ue-clear">
            		<label>申请时间：</label>
            		<div class="time-select">
            			<input type="text" name="minTime" value="${requestScope.search.minTime==null?'':requestScope.search.minTime }" id="id_minTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
            		</div>
            		<span class="line">-</span>
            		<div class="time-select">
            			<input type="text" name="maxTime" value="${requestScope.search.maxTime==null?'':requestScope.search.maxTime }" id="id_maxTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
           		 	</div>
        		</div>
    </div>
    <div class="query-btn ue-clear">
    	<input type="submit" value="查询" style="border-style: none; width: 80px; height: 40px; margin-left: 600px; background-color: green; color: white;"/>
    </div>
</div>
</form>
  		<div class="table-box" >
	<table>
    	<thead>
    	
        	<tr>
            	<th class="num" id="id_num">序号</th>
            	
                <th class="appPerson" id="id_appPerson">申请人</th>
                <th class="proName" id="id_proName">项目名称</th>
                <th class="proType" id="id_proType">项目类型</th>
                <th class="proDetail" id="id_proDetail">项目详情</th>
                <th class="appCash" id="id_appCash">申请资金</th>
                <th class="appTime" id="id_appTime">申请时间</th>
               
                <th class="appStatus" id="id_appStatus">状态</th>
                <th class="operate" id="id_operate">操作</th>
            </tr>
           
        </thead>
        <tbody id="tablebody">
        	<!-- 未审批项目数据 -->
        	 <c:forEach items="${requestScope.project.data_App}" var="pro" varStatus="p">
        	 <input type="hidden" value="${pro.appUserId }"/>
            	<tr onmouseover="choice(this);" onmouseout="leave(this);">
            		<td class="cs">${pro.no }</td>
            		
            		<td class="cs">${pro.appPerson } &nbsp;&nbsp;&nbsp; ${pro.appDept}</td>
            		<td class="cs">${pro.proName }</td>
            		<td class="cs">${pro.proType }</td>
            		<td class="cs"><a href="file/file_finance/${pro.proDetail }">${pro.proFilename }</a></td>
            		<td class="cs">${pro.appCash }</td>
            		<td class="cs">${pro.appTime }</td>
            		
            		<td class="cs">${pro.exeStatus }</td>
            		<td class="cs" id="id_check"><a id="id_a${p.index}" onclick="check('${p.index}','${pro.applyNo }','${pro.appPerson }','${pro.appUserId }');" style="color:blue;">审核</a></td>
            	</tr>
            </c:forEach>
        </tbody>
    </table>
</div>
	<div style="position: absolute;left:700px;bottom: 30px;">
    	<table width="80%" cellspacing="0" cellpadding="0" class="skip_table">
     	<tr>
     		<td><a onclick="skipPage('1');">首页</a></td>
     		<td><a onclick="skipPage('${requestScope.project.currentPage==1?1:requestScope.project.currentPage-1 }');">上一页</a></td>
     		<td><a onclick="skipPage('${requestScope.project.currentPage==requestScope.project.totalPage?(requestScope.project.currentPage):(requestScope.project.currentPage+1) }');">下一页</a></td>
     		<td><a onclick="skipPage('${requestScope.project.totalPage}');">末页</a></td>
     		<td>当前页码：${requestScope.project.currentPage }/${requestScope.project.totalPage}</td>
     	</tr>
     </table>
    </div>
  </body>
  
  
</html>
